package com.njwb.day12.daili;

public class Proxy implements Subject {
    private String name;
    private Subject realSubject;

    public Proxy(String name, Subject realSubject) {
        this.name = name;
        this.realSubject = realSubject;
    }

    private void beforeGetMoney() {
        System.out.println("【代理(" + name + ")准备工作】埋炸弹、绑家人、寄手指...");
    }

    private void afterGetMoney() {
        System.out.println("【代理(" + name + ")收成】抽30%提成。");
    }

    @Override
    public void getMoney() {
        beforeGetMoney();
        realSubject.getMoney();
        afterGetMoney();
    }
}
